<?php defined('IN_IA') or exit('Access Denied');?><?php (!empty($this) && $this instanceof WeModuleSite || 1) ? (include $this->template('base/common-header', TEMPLATE_INCLUDEPATH)) : (include template('base/common-header', TEMPLATE_INCLUDEPATH));?>

<!-- <div class="btn-group" role="group" aria-label="...">
    <a href="<?php  echo aurl('update')?>" class="btn btn-success">新增</a>
    <a href="javascript:;" class="btn btn-primary check-all-control">全选</a>
    <a href="<?php  echo aurl('remove')?>" class="btn btn-danger ajax-post confirm" data-form="#form" data-confirm="确定要删除勾选项吗?">删除</a>
</div> -->
<div style="float: left;">
    <a class="btn btn-success" style="float:right" href="<?php  echo aurl('exportExcel',['act_name' => $_GET['act_name'], 'type'=>$_GET['type']])?>">导出数据</a>
</div>
<form action="<?php  echo aurl('index')?>" id="form_search" class="table-top-search form-inline" style="float: right" method="GET"
    data-search-ignore="page">
    <input type="text" name="act_name" class="form-control" value="<?php  echo $_GET['act_name'];?>" placeholder="搜索活动名称">
    <select name="type">
        <option value="" <?php  if($_GET['type']=='') { ?>selected="selected" <?php  } ?>>
            全部&nbsp;
        </option>
        <option value="skill" <?php  if($_GET['type']=='skill') { ?>selected="selected" <?php  } ?>>
            摇奖&nbsp;
        </option>
        <option value="recommend" <?php  if($_GET['type']=='recommend') { ?>selected="selected" <?php  } ?>>
            推荐&nbsp;
        </option>
    </select>
    <!-- <input type="text" name="act_mobile" class="form-control" value="<?php  echo $_GET['act_mobile'];?>" placeholder="搜索客服电话"> -->

    <?php  echo tpl_form_field_daterange('transfers_time',$_GET['transfers_time'])?>
    <button class="btn btn-warning">搜索</button>&emsp;
    
</form>

<form method="post" class="form-horizontal" id="form" name="form" action="">
    <table class="table table-hover">
        <thead>
            <tr>
                <th>订单编号</th>
                <th>活动名称</th>
                <th>用户信息</th>
                <th>返利类型</th>
                <th>返利方式</th>
                <th>金额</th>
                <th>返利时间</th>
                <th>发送状态</th>
                <th>操作</th>
            </tr>
        </thead>
        <tbody>
            <?php  if(is_array($list)) { foreach($list as $item) { ?>
            <tr>
                <td>
                    <?php  echo $item['transfers_sn'];?>
                </td>
                <td>
                    <?php  echo $item['active_name'];?>
                </td>
                <td>

                    <?php  echo userinfo($item['openid'])['nickname']?>
                
                </td>
                <td>
                    <?php  echo $_W['NS']['transfers_type'][$item['type']];?>
                </td>
                <td>
                    <?php  echo $_W['NS']['transfers_send_type'][$item['send_type']];?>
                </td>
                <td>
                    <?php  echo $item['reward'];?>&nbsp;元
                </td>
                <td>
                    <?php  echo date("Y-m-d H:i:s",$item['create_time'])?>
                </td>
                <td>
                    <?php  echo $_W['NS']['transfers_status'][$item['status']];?> <?php  echo $item['err_msg'];?>
                </td>
                <td>
                    <?php  if($item['status']!='done') { ?>
                    <a class="label label-success ajax-post confirm" href="<?php  echo aurl('reissue', array('trans_id'=>$item['transfers_sn']))?>">补发</a>
                    <?php  } ?>
                </td>
                    
            </tr>
            <?php  } } ?>
        </tbody>
    </table>
    <?php  if(empty($list)) { ?> <p class="text-center">暂无数据</p> <?php  } ?>
    <?php  echo $page;?>
</form>
<script>
    require.config({
        appDir: '.',
        paths: {
            'clipboard': ['<?php echo WEB_RESOURCE;?>/lib/clipboard.min'] // 路径自定义，建议使用自己的文件而不是微擎自带的，微擎自带的clipboard不好使
        }
    });
    
    
</script>
<?php (!empty($this) && $this instanceof WeModuleSite || 1) ? (include $this->template('base/common-footer', TEMPLATE_INCLUDEPATH)) : (include template('base/common-footer', TEMPLATE_INCLUDEPATH));?>